<?php
// $Id: default.php 541 2012-10-11 14:07:02Z tomqin@gmail.com $

class Default_Action extends Action_Front{

    public function __construct(){
        $this->route = 1;//路由1
    }

    function init(){
        if($this->cityid == '2') //bj
            header('Location: /waimai');

        $title = '{CITY}外卖网|{CITY}订餐|网外卖、快餐、网上订餐';
        $keywords = '{CITY}外卖订餐美食网';
        $description = '速订客—{CITY}外卖网，{CITY}订餐，大连美食。{CITY}最好的网上订餐平台，为您提供最新最全的24小时外卖送餐电话、外卖菜单等外卖订餐详细信息。包括肯德基网上订餐电话，麦当劳网上订餐电话。';
        $this->seoContent($title, $keywords, $description);
    }

    function onIndex(){
        $cachename = $this->cityid.'-'.$this->method;

        if(array_get_bool($_GET, 'force')) $html = '';
        else $html = Cache::get($cachename, 24*3600);

        if(!$html){
            ob_start();
            $zone = App::module('zone', '', array($this->cityid));
            $shopList = Db::getAll('SELECT shop_id, name, picture, zone_id, subzone_id FROM `biz_shop` WHERE shop_type=1 ORDER BY RAND() LIMIT 23');
            $newList  = Db::getAll('SELECT shop_id, name, update_dt FROM `biz_shop` WHERE shop_type=1 ORDER BY update_dt DESC  LIMIT 8');

            $this->setVar('zoneInfo', $zone);
            $this->setVar('newList', $newList);
            $this->setVar('shopList', $shopList);
            $this->render('default-index');

            $html = ob_get_contents();
            $html = clean_html($html);
            ob_end_clean();
            Cache::set($cachename, $html);
        }
        echo $html;
    }
}
?>